package cn.com.nes.site.entity.vo.contract;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.UUID;

/**
 * 添加合同信息VO
 *
 * @Author: ShenWei
 * @Date: 2024/03/08/19:06
 */
@Data
@NoArgsConstructor
public class AddContractInfoVo {
    /**
     * 合同编号
     */
    @NotBlank(message = "合同编号不能为空")
    private String htbh;

    /**
     * 销售员id
     */
    @NotBlank(message = "销售员不能为空")
    private String xsyId;

    /**
     * 订货方id
     */
    @NotBlank(message = "订货方不能为空")
    private String dhfId;

    /**
     * 销售数量
     */
    @NotNull(message = "销售数量不能为空")
    private Long xssl;

    /**
     * 已收款比例%
     */
    @NotNull(message = "已收款比例不能为空")
    private BigDecimal yskbl;

    /**
     * 签订日期
     */
    @NotNull(message = "签订日期不能为空")
    private Date qdrq;

    /**
     * 合同类型字典值
     */
    @NotBlank(message = "合同类型不能为空")
    private String htlxId;

    /**
     * 用户所属行政区哈
     */
    private String userxzqh;

    private String manufactureId;

    public AddContractInfoVo(String xzqh, String manufactureId, String xsyId, String dhfId,
                             long xssl) {
        this.htbh = "htbh_" + UUID.randomUUID().toString();
        this.xsyId = xsyId;
        this.dhfId = dhfId;
        this.xssl = xssl;
        this.yskbl = new BigDecimal("0");
        this.qdrq = new Date();
        this.htlxId = "htlx-01";
        this.userxzqh = xzqh;
        this.manufactureId = manufactureId;
    }
}
